<template>
  <el-dropdown @command="commandEvent">
    <span style="color: #fff">
      <svg-icon
        icon-class="language"
        style="width: 30px; heiht: 30px"
      /></span>
    <template #dropdown>
      <el-dropdown-menu>
        <el-dropdown-item
          :disabled="$i18n.locale === 'zh'"
          command="zh"
        >中文</el-dropdown-item>
        <el-dropdown-item
          :disabled="$i18n.locale === 'en'"
          command="en"
        >English</el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>
</template>

<script>
export default {
  name: 'Lang',
  methods: {
    commandEvent(command) {
      this.$i18n.locale = command
    }
  }
}
</script>

<style></style>
